package com.javalong.affairs.base.constant;

import android.util.SparseArray;

public class StatusCode {
    private static SparseArray<String> sendCodeMap;
    private static SparseArray<String> receiveCodeMap;
    private static SparseArray<String> statisticCodeMap;
    private static SparseArray<String> scheduleCodeMap;
    private static SparseArray<String> taskCodeMap;

    static {
        sendCodeMap = new SparseArray<String>();
        sendCodeMap.append(0, "未审核");
        sendCodeMap.append(1, "已审核");
        sendCodeMap.append(2, "审核未通过");
        sendCodeMap.append(3, "超时未审核");

        receiveCodeMap = new SparseArray<String>();
        receiveCodeMap.append(-1, "删除");
        receiveCodeMap.append(0, "未读");
        receiveCodeMap.append(1, "确认");
        receiveCodeMap.append(2, "请假");
        receiveCodeMap.append(3, "委托");
        receiveCodeMap.append(9, "已读");
        // （ -1删除，0未读 ， 1确认 ， 2请假 ， 3委托中(顶级委托人) ， 4委托成功(顶级委托人) ，5委托中(非顶级) ，
        // 6委托成功(非顶级) ， 7确认委托 ）
        statisticCodeMap = new SparseArray<String>();
        statisticCodeMap.append(-1, "删除");
        statisticCodeMap.append(0, "未读");
        statisticCodeMap.append(1, "确认");
        statisticCodeMap.append(2, "请假");
        statisticCodeMap.append(3, "委托中");
        statisticCodeMap.append(4, "委托成功");
        statisticCodeMap.append(5, "委托中");
        statisticCodeMap.append(6, "委托成功");
        statisticCodeMap.append(7, "确认委托");
        statisticCodeMap.append(9, "已读");

        scheduleCodeMap = new SparseArray<String>();
        scheduleCodeMap.append(-1, "删除");
        scheduleCodeMap.append(0, "进行中");
        scheduleCodeMap.append(1, "完成");
        scheduleCodeMap.append(2, "未完成");

        //发送状态( -10未通过，0未发出，10未审核 ，30进行中，50已提交 )
        taskCodeMap = new SparseArray<String>();
        taskCodeMap.append(-10, "未通过");
        taskCodeMap.append(0, "未发出");
        taskCodeMap.append(10, "未审核");
        taskCodeMap.append(30, "进行中");
        taskCodeMap.append(50, "已提交");
    }

    public static String getReceiveStatus(int statusCode) {
        return receiveCodeMap.get(statusCode);
    }

    public static String getTaskStatus(int statusCode) {
        return taskCodeMap.get(statusCode);
    }

    public static String getSendStatus(int statusCode) {
        return sendCodeMap.get(statusCode);
    }

    public static String getSendStatus2(int statusCode, int del) {

        if (statusCode == -1) {
            return "未审核";
        }
        if (del == 1) {
            return "审核未通过";
        } else {
            return "已审核";
        }
    }

    public static String getStatisticStatus(int statusCode) {
        return statisticCodeMap.get(statusCode);
    }

    public static String getScheduleStatus(int statusCode) {
        return scheduleCodeMap.get(statusCode);
    }
}
